import request from '@/utils/axiosUtils.js'
//import { da } from 'element-plus/es/locale'


export const hospitalInfoService = () => {
    return request({
        url: '/hospital',
        method: 'get',
    })
}

export const mealInfoService = (data) => {
    //console.log(data)
    return request({
        url: '/setmeal',
        method: 'get',
        params: {
            sex: data
        }
    })
}


export const getOneHpService = (id) => {
    return request({
        url: `/hospital/${id}`,
        method: 'get'
    })
}

export const getOneMlService = (id) => {
    return request({
        url: '/setmeal/id',
        method: 'get',
        params: {
            id: id
        }
    })
}

export const createOrderService = (data) => {
    //console.log(data)
    return request({
        url: '/orders',
        method: 'post',
        data: {
            date: data.date,
            hpId: data.hpId,
            smId: data.smId
        }
    })
}



export const cancelOrdersService = (data) => {

    return request({
        url: '/orders',
        method: 'delete',
        params: {
            id: data.orderid
        }
    })
}



export const reportlistService = () => {
    return request({
        url: '/orders',
        method: 'get',
    })
}

export const reportService = (id) => {
    //console.log(id)
    return request({
        url: '/report',
        method: 'get',
        params: {
            orderid: id
        }
    })
}

export const mealsOptionService = () => {
    return request({
        url: '/setmeal/all',
        method: 'get'
    })
}

export const getAllOrdersService = (data) => {
    console.log(data)
    return request({
        url: '/orders',
        method: 'get',
        params: {
            phone: data.phone,
            realName: data.realName,
            sex: data.sex,
            smid: data.smid,
            orderdate: data.orderdate,
            state: data.state,
            page: data.page,
            size: data.size
        }
    })
}

export const clearCache = () => {
    return request({
        url: '/orders/clear',
        method: 'get',
    })
}